import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";

var _dec, _class;

import React, { Component } from 'react';
import { Modal, Progress, Form, Button } from 'antd';
import intl from 'utils/intl';
var ProgressModal = (_dec = Form.create({
  fieldNameProp: null
}), _dec(_class = /*#__PURE__*/function (_Component) {
  _inherits(ProgressModal, _Component);

  var _super = _createSuper(ProgressModal);

  function ProgressModal() {
    _classCallCheck(this, ProgressModal);

    return _super.apply(this, arguments);
  }

  _createClass(ProgressModal, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          onOk = _this$props.onOk,
          progressVisible = _this$props.progressVisible,
          _this$props$progressV = _this$props.progressValue,
          progressValue = _this$props$progressV === void 0 ? {} : _this$props$progressV;
      var _progressValue$progre = progressValue.progress,
          progress = _progressValue$progre === void 0 ? 0 : _progressValue$progre,
          _progressValue$messag = progressValue.message,
          message = _progressValue$messag === void 0 ? '' : _progressValue$messag;
      return /*#__PURE__*/React.createElement(Modal, {
        title: intl.get('csdr.jobLog.model.jobLog.taskProgress').d('任务进度'),
        visible: progressVisible,
        width: 520,
        destroyOnClose: true,
        closable: false,
        footer: /*#__PURE__*/React.createElement(Button, {
          type: "primary",
          onClick: onOk
        }, intl.get('cpaas.common.button.ok').d('确定'))
      }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
        style: {
          textAlign: 'center',
          margin: '4px 0'
        }
      }, message), /*#__PURE__*/React.createElement(Progress, {
        percent: progress
      })));
    }
  }]);

  return ProgressModal;
}(Component)) || _class);
export { ProgressModal as default };